﻿<Window x:Class="OutlookNavigationPanelTest.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:OutlookNavigationPanelTest"
        xmlns:s="NavigationPane"
        Title="MainWindow"
        Width="300"
        Height="600">

    <Window.Resources>

        <DataTemplate x:Key="DataTemplate1">
            <Grid>
                <TextBlock Text="{Binding Path=Name}" />
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="DataTemplate2">
            <StackPanel>
                <TextBlock Text="{Binding Path=Name}" />
                <ListBox ItemsSource="{Binding Path=Rows}" />
            </StackPanel>
        </DataTemplate>

    </Window.Resources>

    <Grid>
        <s:NavigationPane x:Name="navigationPane"
                          ContentTemplate="{DynamicResource DataTemplate2}"
                          IsMinimizeButtonVisible="False"
                          ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor,
                                                                               AncestorType=my:Window1,
                                                                               AncestorLevel=1},
                                                Path=Data}"
                          ItemTemplate="{DynamicResource DataTemplate1}"
                          LargeItems="3">
            <s:NavigationPane.ItemsButtonsContextMenu>
                <ContextMenu>
                    <s:ConfigureMenuItem MenuType="Options" />
                </ContextMenu>
            </s:NavigationPane.ItemsButtonsContextMenu>
        </s:NavigationPane>
    </Grid>
</Window>
